package agent.impl;


import framework.api.KnowledgeBuilderResult;
import framework.api.Message;
import framework.api.Results;
import framework.impl.MessageImpl;

import java.util.ArrayList;
import java.util.List;

public class ResultsImpl implements Results {

    private List<Message> messages    = new ArrayList<Message>();
    private long      idGenerator = 1L;

    public MessageImpl addMessage(KnowledgeBuilderResult result) {
        MessageImpl message = new MessageImpl( idGenerator++, result );
        messages.add( message );
        return message;
    }

    public MessageImpl addMessage(Message.Level level, String path, String text) {
        MessageImpl message = new MessageImpl( idGenerator++, level, path, text );
        messages.add( message );
        return message;
    }
}
